﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys7a00
    {
		private string _listid;
		private string _comcode;
		private string _usercode;
		private string _pagename;
		private string _sortstr;
		
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 公司代码
        /// </summary>
		public string Comcode
		{
			get { return _comcode;	 }
			set { _comcode=value;	}
		}
        /// <summary>
        /// 用户代码
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 模块页面
        /// </summary>
		public string Pagename
		{
			get { return _pagename;	 }
			set { _pagename=value;	}
		}
        /// <summary>
        /// 自定义排序字符串
        /// </summary>
		public string Sortstr
		{
			get { return _sortstr;	 }
			set { _sortstr=value;	}
		}
		
		public static List<Sys7a00> GetSys7a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys7a00> list = new List<Sys7a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys7a00 model = GetSys7a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys7a00 GetSys7a00ByDataRow(DataRow dr)
		{
			Sys7a00 model = new Sys7a00(); //实例化Sys7a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("comcode")&&!(dr["comcode"] is System.DBNull))  
				model.Comcode = ( string)dr["comcode"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("pagename")&&!(dr["pagename"] is System.DBNull))  
				model.Pagename = ( string)dr["pagename"];
			if (dcc.Contains("sortstr")&&!(dr["sortstr"] is System.DBNull))  
				model.Sortstr = ( string)dr["sortstr"];
			
			return model;
		}
    }
}
